import request from '@/utils/request'
import config from '@/utils/config'
import { splitStr } from './common'

// 获取讲师列表
export function getTeacherList(params) {
  return request({
    url: config.BaseUrl + '/teacher/page',
    method: 'get',
    params: splitStr(params)
  })
}

// 查询讲师详情
export function getTeacherDetail(tid) {
  return request({
    url: config.BaseUrl + '/server/teacher/' + tid,
    method: 'get'
  })
}

// 编辑讲师
export function edit(params) {
  return request({
    url: config.BaseUrl + '/teacher/update',
    method: 'post',
    data: params
  })
}

// 编辑停用启用
export function teacherUpdateStatus(params) {
  return request({
    url: config.BaseUrl + '/teacher/update/status',
    method: 'post',
    data: params
  })
}

// 新增讲师
export function add(params) {
  return request({
    url: config.BaseUrl + '/teacher',
    method: 'post',
    data: params
  })
}

// 查询讲师绑定银行卡
export function teacherBankCardInfo(tid) {
  return request({
    url: config.BaseUrl + '/teacher/bankCardInfo/' + tid,
    method: 'get'
  })
}

// 绑定银行卡
export function bindCard(params) {
  return request({
    url: config.BaseUrl + '/server/bind/bankCard',
    method: 'post',
    data: params
  })
}
